import { defineStore } from 'pinia'

interface dialogType {
  visible: boolean // 弹框是否打开
}

export const useDialog = defineStore({
  id: 'useDialogStore',
  state: (): dialogType => ({
    visible: false
  }),
  actions: {
    setVisible(newVisible: boolean) {
      this.visible = newVisible
    }
  },
  getters: {
    hasVisible(state) {
      return state.visible
    }
  }
})
